'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    // Add email column to users table
    await queryInterface.addColumn('users', 'email', {
      type: Sequelize.STRING,
      allowNull: false, // Make it required
      unique: true, // Make it unique
      comment: '用户邮箱', // Add comment
    });
  },

  async down(queryInterface, Sequelize) {
    // Remove email column from users table
    await queryInterface.removeColumn('users', 'email');
  }
};
